import java.util.*;

class IntCmp implements Comparator<Integer> {

    @Override
    public int compare(Integer o1, Integer o2) {
        return o2 - o1;
    }
}


public class Text {
    public static void main(String[] args) {
        Heap heap = new Heap();
        int[] array = {27,15,19,18,28,34,65,49,25,37};
        int size = array.length;
        heap.InitArray(array);
        heap.createHeap();
        System.out.println(Arrays.toString(heap.elem));
        PriorityQueue<Integer> qu1 = new PriorityQueue<>();//容量默认为1
        PriorityQueue<Integer> qu2 = new PriorityQueue<>(100);
        List<Integer> list = new ArrayList<>();
        list.add(4);
        list.add(3);
        list.add(2);
        list.add(1);
        //用ArrayList对象构造一个优先级队列的对象
        PriorityQueue<Integer> qu3 = new PriorityQueue<>(list);

        System.out.println(qu3.size());
        System.out.println(qu3.peek());
        //大堆
        PriorityQueue qu4 = new PriorityQueue(new IntCmp());
    }
}
